package com.ssy.lingxi.platform.manage.api.feign.inner;


import com.ssy.lingxi.common.model.dto.MemberAndRoleIdDTO;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.manage.api.hystrix.inner.ShopControllerFeignFallback;
import com.ssy.lingxi.platform.manage.api.model.dto.common.CommonIdListDTO;
import com.ssy.lingxi.platform.manage.api.model.dto.shop.SelfBusinessShopLogoDTO;
import com.ssy.lingxi.platform.manage.api.model.dto.shop.TemplateIdDTO;
import com.ssy.lingxi.platform.manage.api.model.vo.shop.SelfBusinessShopLogoVO;
import com.ssy.lingxi.platform.manage.api.model.vo.shop.ShopInnerVO;
import com.ssy.lingxi.platform.manage.api.model.vo.shop.ShopVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.List;

/**
 * @author fhj
 * @version 2.0.0
 * @menu 商城 - （系统初始化）PAAS接口
 * @date 2020/07/23
 */
@FeignClient(value = "platform-manage-service", fallback = ShopControllerFeignFallback.class)
public interface ShopControllerFeign {

    @ApiOperation(value = "获取自营商家的商城LOGO（内部接口）")
    @PostMapping("/manage/shopWeb/feign/findSelfBusinessShopLogo")
    Wrapper<List<SelfBusinessShopLogoVO>> findSelfBusinessShopLogo(@RequestBody SelfBusinessShopLogoDTO dto);

    @ApiOperation(value = "获取自营商家的商城ID（内部接口）")
    @PostMapping("/manage/shopWeb/feign/findSelfBusinessShopId")
    Wrapper<List<Long>> findSelfBusinessShopId(@RequestBody MemberAndRoleIdDTO dto);

    @ApiOperation(value = "根据商城ID集合获取商城(内部接口)")
    @PostMapping("/manage/shopWeb/feign/byIds")
    Wrapper<List<ShopInnerVO>> shopByIds(@RequestBody @Valid CommonIdListDTO request);

    @ApiOperation(value = "查询所有商城信息")
    @GetMapping("/manage/shop/all")
    Wrapper<List<ShopVO>> shopAll();

    @ApiOperation(value = "根据商城类型和环境查询商城信息")
    @GetMapping("/manage/shop/findAllByShopTypeAndEnvironment")
    Wrapper<List<ShopVO>> findAllByShopTypeAndEnvironment(@RequestParam("shopType") Integer shopType, @RequestParam("environment") Integer environment);

    @ApiOperation(value = "根据商城ID集合获取商城")
    @PostMapping("/manage/shop/byIdList")
    Wrapper<List<ShopVO>> shopByIdList(@RequestBody @Valid CommonIdListDTO request);

    /**
     * 根据商城ID集合获取商城(新接口)
     */
    @PostMapping("/manage/shopWeb/feign/byShopIds")
    Wrapper<List<ShopVO>> byShopIds(@RequestBody @Valid CommonIdListDTO request);

}
